<template>
    <div class="top">
      <div>
        <router-link v-if="isIcon" to="/">
          <img src="../assets/imgs/返回.png" alt="" />
        </router-link>
      </div>
      <span>{{ til }}</span>
      <div><slot name="right"></slot></div>
    </div>
  </template>
  
  <script>
  export default {
    props: {
      til: {
        type: String,
        default: "标题",
      },
      isIcon: {
        type: Boolean,
        default: true,
      },
    },
  };
  </script>
  
  <style scoped>
  .top {
    display: flex;
    padding: 10px;
    align-items: center;
    background: #f1f1f1;
    letter-spacing: 2px;
    font-size: 18px;
    justify-content: space-between;
  }
  .top div {
    width: 40px;
  }
  
  .top img {
    width: 30px;
    height: 30px;
  }
  </style>
  